/*
 * Copyright (c) 2018. czmc All Rights Reserved.
 * Author: czmc
 * Email: zxc6355533@163.com
 * Encoding: UTF-8
 */

package top.stime21.myneighbours.base

import android.content.Context
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import top.stime21.framework.mvp.LoadingDialog
import top.stime21.framework.mvp.MvpView


/**
 * Author: czmc  Email: zxc6355533@163.com
 * Version:	1.0  Date:2018/3/1
 */
abstract class BuzBaseFragment : Fragment(), MvpView {
    val loadding: LoadingDialog by lazy {
        LoadingDialog(context!!)
    }
    lateinit var rootView:View
    override fun context(): Context {
        return context!!
    }

    override fun showToast(str: String) {
       Toast.makeText(context,str,Toast.LENGTH_SHORT).show()
    }
    override fun showLoadding() {
        loadding.show()
    }

    override fun hideLodding() {
        loadding.hide()
    }
    override fun showEmpty(){

    }

    override fun showViewLoadding() {
    }
    override fun showContent(){

    }
    override fun showError() {
    }

    abstract fun getLayoutId():Int

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        rootView = inflater!!.inflate(getLayoutId(),null,false)
        return rootView
    }

    override fun onLoginTimeOut() {

    }

}